{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import lpsim"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "target_version = '4.5'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Cat Grass Cardamom|猫草豆蔻|status/Debuff_Momoka_E.png\n",
      "Day of Resistance: Moment of Shattered Dreams|抗争之日·碎梦之时|BARRIER\n",
      "Electro Cicin|雷萤|DEBUFF\n",
      "Electro Cicin Shield|雷萤护罩|SHIELD\n",
      "Equitable Judgment|衡平推裁|SPECIAL\n",
      "Fortress of Meropide|梅洛彼得堡|COUNTER\n",
      "Heir to the Ancient Sea's Authority|遗龙之荣|ATK_UP\n",
      "Jade Chamber|群玉阁|NONE\n",
      "Knights of Favonius Library|骑士团图书馆|NONE\n",
      "Lumenstone Adjuvant|流明石触媒|COUNTER\n",
      "Shield of Safe Transport|安全运输护盾|SHIELD\n",
      "Snappy Silhouette|瞬时剪影|DEBUFF_ELEMENT_ICE\n",
      "Sourcewater Droplet|源水之滴|status/Neuvillette_S.png\n",
      "Surging Thunder|霆电迸发|SPECIAL\n",
      "Tome of the Eternal Flow|万世流涌大典|ATK_UP\n",
      "Urgent Neko Parcel|猫箱急件|status/Momoka_S.png\n"
     ]
    }
   ],
   "source": [
    "from lpsim.server.card.support.base import SupportBase\n",
    "from lpsim.server.character.character_base import CharacterBase\n",
    "from lpsim.server.character.dendro import nahida_3_7\n",
    "from lpsim.server.object_base import CardBase, ObjectBase\n",
    "from lpsim.server.status.base import StatusBase\n",
    "from lpsim.server.summon.base import SummonBase\n",
    "from lpsim.utils.class_registry import get_class_list_by_base_class, get_instance\n",
    "from lpsim.utils.desc_registry import get_desc_patch\n",
    "\n",
    "\n",
    "full_desc = get_desc_patch()\n",
    "\n",
    "\n",
    "classes = get_class_list_by_base_class(SupportBase | StatusBase)\n",
    "for cls_name in classes:\n",
    "    try:\n",
    "        instance = get_instance(\n",
    "            SupportBase | StatusBase,\n",
    "            {'name': cls_name, 'version': target_version, 'position': {\n",
    "                'player_idx': -1, \n",
    "                'id': 0,\n",
    "                'area': 'INVALID'\n",
    "            }}\n",
    "        )\n",
    "        if len(target_version) and instance.version != target_version:\n",
    "            continue\n",
    "        try:\n",
    "            output = instance.icon_type\n",
    "            key = f'{instance.type}/{instance.name}'\n",
    "            if output == 'OTHERS':\n",
    "                output = full_desc[key]['image_path']\n",
    "            print(f'{full_desc[key][\"names\"][\"en-US\"]}|{full_desc[key][\"names\"][\"zh-CN\"]}|{output}')\n",
    "        except Exception as e:\n",
    "            print('failed to get name or icon_type for', cls_name, e)\n",
    "    except Exception as e:\n",
    "        # print('instantiation failed for', cls_name, e)\n",
    "        # print('!!!instantiation failed for', cls_name)\n",
    "        pass"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "GITCG",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
